<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>超级链接的美化</title>
</head>
<style>
    *{
        padding: 0;
        margin: 0;
        list-style: none;
        text-decoration: none;
        font-family: "Microsoft YaHei UI";
    }

    body{
        background: url('01_HTML/images/bg01.jpg') repeat left top;
    }

    .nav{
        width: 960px;
        margin:100px auto 0;
    }

    .nav ul li{
        float: left;
        width: 120px;
        height: 40px;
        text-align: center;
    }

    .nav ul li a{
        display: block;
        width: 100%;
        line-height: 40px;
        background-color: green;
        color: black;
    }
    .nav ul li a:hover,.nav ul li a.selected{
        font-size: 18px;
        background-color: gray;
        color: white;
    }

    .leftRadius{
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
    }

    .rightRadius{
        border-top-right-radius:10px;
        border-bottom-right-radius:10px;
    }
</style>
<script src="../libs/jquery3_1_1.min.js"></script>
<script>
    $(function () {
        $('.nav a').click(function () {
            console.log('点击了:'+$(this).index());
            $(this).addClass('selected').siblings().removeClass('selected');
        });
    });
</script>
<body>
    <div class="nav">
        <ul>
            <li><a href="#" class="leftRadius selected">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#">网站栏目</a></li>
            <li><a href="#" class="rightRadius">网站栏目</a></li>
        </ul>
    </div>
</body>
</html>